package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.domain.dto.TeamRelevanceRoleDto;
import cn.cdeden.knowledge.domain.dto.TeamRelevanceTypeDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
//import io.swagger.annotations.ApiModelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author Chen
* @date 2024-04-21
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@AutoMappers({@AutoMapper(target = TeamRelevanceTypeDto.class)})
@TableName("team_relevance_type")
public class TeamRelevanceType implements Serializable {
    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "id")
    @TableId(type= IdType.AUTO)
    private Integer id;

//    @ApiModelProperty(value = "团队id")
    private String teamId;

//    @ApiModelProperty(value = "用户id")
    private String userId;

//    @ApiModelProperty(value = "分类id")
    private Integer typeId;

//    @ApiModelProperty(value = "创建者")
    @TableField(fill= FieldFill.INSERT)
    private String createId;

//    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

//    @ApiModelProperty(value = "更新者")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateId;

//    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void copyFrom(TeamRelevanceType source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
